/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ch.ffhs.perellano.volunteers;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author perellano
 */
@Entity
@Table(name = "PLZGEOCODE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Plzgeocode.findAll", query = "SELECT p FROM Plzgeocode p"),
    @NamedQuery(name = "Plzgeocode.findById", query = "SELECT p FROM Plzgeocode p WHERE p.id = :id"),
    @NamedQuery(name = "Plzgeocode.findByLand", query = "SELECT p FROM Plzgeocode p WHERE p.land = :land"),
    @NamedQuery(name = "Plzgeocode.findByPlz", query = "SELECT p FROM Plzgeocode p WHERE p.plz = :plz"),
    @NamedQuery(name = "Plzgeocode.findByOrt", query = "SELECT p FROM Plzgeocode p WHERE p.ort = :ort"),
    @NamedQuery(name = "Plzgeocode.findByLatitude", query = "SELECT p FROM Plzgeocode p WHERE p.latitude = :latitude"),
    @NamedQuery(name = "Plzgeocode.findByLongitude", query = "SELECT p FROM Plzgeocode p WHERE p.longitude = :longitude"),
    @NamedQuery(name = "Plzgeocode.findByZuverlaessigkeit", query = "SELECT p FROM Plzgeocode p WHERE p.zuverlaessigkeit = :zuverlaessigkeit")})
public class Plzgeocode implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Size(max = 150)
    @Column(name = "LAND")
    private String land;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "PLZ")
    private String plz;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "ORT")
    private String ort;
    @Basic(optional = false)
    @NotNull
    @Column(name = "LATITUDE")
    private double latitude;
    @Basic(optional = false)
    @NotNull
    @Column(name = "LONGITUDE")
    private double longitude;
    @Column(name = "ZUVERLAESSIGKEIT")
    private Integer zuverlaessigkeit;

    public Plzgeocode() {
    }

    public Plzgeocode(Integer id) {
        this.id = id;
    }

    public Plzgeocode(Integer id, String plz, String ort, double latitude, double longitude) {
        this.id = id;
        this.plz = plz;
        this.ort = ort;
        this.latitude = latitude;
        this.longitude = longitude;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLand() {
        return land;
    }

    public void setLand(String land) {
        this.land = land;
    }

    public String getPlz() {
        return plz;
    }

    public void setPlz(String plz) {
        this.plz = plz;
    }

    public String getOrt() {
        return ort;
    }

    public void setOrt(String ort) {
        this.ort = ort;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public Integer getZuverlaessigkeit() {
        return zuverlaessigkeit;
    }

    public void setZuverlaessigkeit(Integer zuverlaessigkeit) {
        this.zuverlaessigkeit = zuverlaessigkeit;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Plzgeocode)) {
            return false;
        }
        Plzgeocode other = (Plzgeocode) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ch.ffhs.perellano.volunteers.Plzgeocode[ id=" + id + " ]";
    }
    
}
